#include<iostream>
#include<vector>

using namespace std;
vector<vector<int>>numsr;
vector<int>temp;

void my_Unique(int arr[],int length)
{
    if (temp.size() == length)
    {
        numsr.push_back(temp);
        return;
    }

    for (int i = 0; i < 20; i++)
    {
        if (arr[i] > 0)
        {
            arr[i] -= 1;
            temp.push_back(i - 10);
            my_Unique(arr, length);
            arr[i] += 1;
            temp.pop_back();
        }
    }

}

vector<vector<int>> permuteUnique(vector<int>& nums) {
    int arr[21] = { 0 };
    int length = nums.size();
    for (int i = 0; i < length; i++)
    {
        arr[i + 10] += 1;
    }
    my_Unique(arr,length);
    return numsr;
}

int main()
{
	return 0;
}